﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AspZone.Commerce.Model.Domain;

namespace AspZone.Commerce.Web.Controllers
{
    public class CatalogController : Controller
    {
        private ICategoryRepository categoryRepository;

        public CatalogController(ICategoryRepository categoryRepository)
        {
            this.categoryRepository = categoryRepository;
        }

        public ActionResult Index()
        {
            ViewData["Categories"] = this.categoryRepository.FindRootCategories();
            return View();
        }

        public ActionResult Category(string seoName)
        {
            ViewData["Categories"] = this.categoryRepository.FindRootCategories();
            return View();
        }

    }
}
